<template>
    <view class="content" v-if="isShow">
        <view class="title text-lg">基础信息</view>
        <view class="box text-noraml">
            <view class="item">
                <view>退货单号</view>
                <view class="item-r text-bold">{{data.refund_order_no}}</view>
            </view>
            <view class="item">
                <view>购货企业</view>
                <view class="item-r text-bold">{{data.shop}}</view>
            </view>
            <view class="item">
                <view>购货企业采购人员</view>
                <view class="item-r text-bold">{{data.buyer}}</view>
            </view>
            <view class="item">
                <view>合计金额(元)</view>
                <view class="item-r text-bold">￥{{data.order_amount}}</view>
            </view>
        </view>
        
        <view class="title text-lg">药品信息</view>
        <view class="wrapper">
            <view class="drug text-noraml" v-for="(item, index) in data.goods_list" :key="index">
                <view class="drug-name text-bold">{{item.goods_name}}</view>
                <view class="drug-down-l text-df text-gray">
                    <view class="u-p-t-15" v-if="item.dosage">剂型：{{item.dosage}}</view>
                    <view class="u-p-t-15">规格：{{item.goods_spec}}</view>
                    <view class="u-p-t-15">生产厂商：{{item.factory}}</view>
                    <view class="u-p-t-15">批号：{{item.batch}}</view>
                    <view class="u-p-t-15">生产日期：{{item.produce_date}}</view>
                    <view class="u-p-t-15">有效日期：{{item.period_date}}</view>
                    <view class="u-p-t-15">销售数量：{{item.goods_nums}}</view>
                    <view class="u-p-t-15">售后数量：{{item.refund_nums}}</view>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                id: '',
                data: {},
                isShow: false,
            };
        },
        onLoad(option) {
            this.id = option.id
            this.getData()
        },
        methods: {
            getData() {
            	this.$ajax('inventory_out/order_refund_detail', {
                    userToken: this.$getSync('userToken'),
                    id: this.id,
                }).then(ret => {
            		if (ret.status == 0) {
                        this.data = ret.data
                        this.isShow = true
            		} else {
            			this.$toast(ret.message);
            		}
            	});
            },
        }
    };
</script>

<style lang="scss">
    
    page{
        background-color: #f5f5f5 !important;
    }
    .title{
        font-weight: bold;
        padding: 45rpx 50rpx 25rpx;
        position: relative;
    }
    .title::after{
        display: block;
        content: '';
        width: 8rpx;
        height: 26rpx;
        background-color: #ff4800;
        position: absolute;
        left: 25rpx;
        bottom: 32rpx;
    }
    
    
    .box{
        padding: 0 30rpx;
        background-color: #fff;
    }
    .item{
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 30rpx 0;
        border-bottom: 2rpx solid #e6e6e6;
    }
    .item:last-child{
        border-bottom: none;
    }
    .item-r{
        flex: 1;
        word-break: break-all;
        white-space: pre-line;
        text-align: right;
        padding-left: 20rpx;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }
    .item-img{
        padding: 30rpx 0;
    }
    .img{
        width: 310rpx;
        height: 200rpx;
        border-radius: 10rpx;
        margin-top: 20rpx;
        margin-right: 10rpx;
    }
    .img:nth-child(2n) {
        margin-right: 0;
    }
    
    
    .drug{
        background-color: #fff;
        border-radius: 15rpx;
        padding: 35rpx 15rpx;
        margin-bottom: 25rpx;
    }
    .drug:last-child{
        margin-bottom: 0;
    }
    .drug-top{
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .drug-name{
        flex: 1;
        word-break: break-all;
        white-space: pre-line;
        padding-left: 15rpx;
    }
    .drug-state1{
        font-size: 24rpx;
        color: #0075ff;
        padding: 9rpx 12rpx;
        background-color: #ebf4fe;
        border-radius: 8rpx;
        margin-left: 20rpx;
    }
    .drug-state2{
        font-size: 24rpx;
        color: #00c28f;
        padding: 9rpx 12rpx;
        background-color: #e9fbf6;
        border-radius: 8rpx;
        margin-left: 20rpx;
    }
    .drug-down{
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
    }
    .drug-down-l{
        flex: 1;
        word-break: break-all;
        white-space: pre-line;
        padding-left: 15rpx;
        padding-right: 15rpx;
    }
    .img-box{
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
    }
    .drug-btn{
        color: #fff;
        padding: 17rpx 43rpx;
        background-color: #ff4800;
        border-radius: 8rpx;
        margin-left: 20rpx;
    }
    
    
    .examine{
        word-break: break-all;
        white-space: pre-line;
        padding: 15rpx 25rpx 30rpx;
        background-color: #fff;
        border-radius: 15rpx;
        margin: 0 30rpx 25rpx;
    }
    .t-inp{
        width: 100%;
        min-height: 150rpx;
        height: auto;
        padding-top: 15rpx;
    }
    .examine2{
        padding: 15rpx 0;
    }
    .img-box{
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
    }
    .up-photo{
        width: 187rpx;
        height: 187rpx;
        margin-right: 15rpx;
        margin-top: 15rpx;
    }
    
    
    .btns{
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin: 30rpx;
    }
    .refuse-btn{
        font-size: 34rpx;
        color: #757575;
        padding: 25rpx 130rpx;
        background-color: #fff;
        border: 2rpx solid #d8d8d8;
        border-radius: 10rpx;
    }
    .take-btn{
        font-size: 34rpx;
        color: #fff;
        padding: 25rpx 130rpx;
        background-color: #ff4800;
        border-radius: 10rpx;
        margin-left: 20rpx;
    }
    
    .enter-btn{
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding-top: 10rpx;
    }
    .enter-btn>view{
        padding: 15rpx 50rpx;
        background-color: #8392a5;
        border-radius: 10rpx;
        color: #fff;
    }
    
    .place{
        word-break: break-all;
        white-space: pre-line;
        padding: 5rpx 20rpx 20rpx;
        background-color: #f5f6f8;
        border-radius: 10rpx;
    }
    .wrapper{
        padding: 0 30rpx;
    }
    .choose-01{
        width: 33rpx;
        height: 33rpx;
        margin-right: 15rpx;
    }
    .time-02{
        width: 33rpx;
        height: 34rpx;
        margin-left: 15rpx;
    }

</style>
